package pl.edu.agh.nn.backpropagation;

import pl.edu.agh.nn.neuron.AbstractSynapse;
import pl.edu.agh.nn.neuron.IOutputProducer;

public class BackPropagationSynapse extends AbstractSynapse {

	private double previousChange;

	public BackPropagationSynapse(IOutputProducer from) {
		super(from);
		previousChange = 0;
	}

	public void changeWeight(double d, double momentum) {
		double thisChange = d + momentum * previousChange;
		weight += thisChange;
		previousChange = thisChange;
	}

}
